package org.jay.angla.utils;

import org.jay.angla.onlab.OnlabApplication;

public class Utils {
	public static float getFloat1(float val) {
		return (float) (Math.round(val * 10)) / 10;
	}

	public static float getFloat2(float val) {
		return (float) (Math.round(val * 100)) / 100;
	}

	public static float getFloat3(float val) {
		return (float) (Math.round(val * 1000)) / 1000;
	}

	public static float getFloat4(float val) {
		return (float) (Math.round(val * 10000)) / 10000;
	}

	public static int getBaselineA(float wavelength) {
		int[] base = OnlabApplication.getInstance().getSpUtil().getBaseline();
		int wl = (int) wavelength;
		return base[wl - 190];
	}
}
